package net.melon.sysres.pojo;

import net.esj.basic.annotation.IgnorePrint;
import net.esj.basic.pojo.AbstractPojo;
import net.esj.basic.pojo.system.UserRule;

public class SysUserRule extends AbstractPojo<String> implements UserRule {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8991444783970870187L;
	
	private String id;
	private String clazzStr;
	private String sessionKey;
	private String sessionBag;
	private String description;
	private String authModel;
	
	private Class userClass;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getSessionKey() {
		return sessionKey;
	}
	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}
	public String getClazzStr() {
		return clazzStr;
	}
	public void setClazzStr(String clazzStr) {
		this.clazzStr = clazzStr;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getAuthModel() {
		return authModel;
	}
	public void setAuthModel(String authModel) {
		this.authModel = authModel;
	}
	public String getSessionBag() {
		return sessionBag;
	}
	public void setSessionBag(String sessionBag) {
		this.sessionBag = sessionBag;
	}
	@SuppressWarnings("unchecked")
	@IgnorePrint
	public Class getUserClass(){
		if(userClass==null){
			try {
				userClass =Class.forName(clazzStr);
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
		return userClass;
	}
}
